package com.chengdu.third.service.Impl;

import com.chengdu.third.dao.IAreaDao;
import com.chengdu.third.pojo.Area;
import com.chengdu.third.service.IAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jingbo
 * @create 2021--08--15  21:06
 */

@Service
public class IAreaServiceImpl implements IAreaService {

    @Autowired
    private IAreaDao iAreaDao;

    @Override
    public List<Area> findAll() {
         return  iAreaDao.find();
    }

    @Override
    public void deleteOne(long id) {
          iAreaDao.delete(id);
    }

    @Override
    public void updateArea(Area area) {
        iAreaDao.update(area);
    }

    @Override
    public void addArea(Area area) {
        iAreaDao.add(area);
    }

    @Override
    public Area getAreaByid(long id) {
     return  iAreaDao.getAreaById(id);
    }
}
